<template>
  <div class="topPic">
    <div class="template-default">
      <div
        class="topic-img"
        :class="propsData.params.lineNum == 2 ? 'heigter-img' : ''"
      >
        <img :src="topicImg" alt="" />
      </div>
      <div class="topic-body">
        <div
          class="topic-body-item"
          v-for="(item, index) in propsData.params.lineNum"
          :key="index"
        >
          <p class="topic-word" :style="propsData.params.css">
            封神世界领红包版是一款红包款红爆网络的手游新作
          </p>
          <p class="more">更多</p>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import topicLineOne from "@/assets/images/diy/toPic/topic_line_one.png";
import topicLineTwo from "@/assets/images/diy/toPic/topic_line_two.png";

export default {
  name: "",
  props: {
    propsData: {
      type: Object,
      default: {},
    },
  },
  data() {
    return {};
  },
  mounted() {},
  watch: {},
  computed: {
    topicImg() {
      if (this.propsData.params.styleType == 1) {
        if (this.propsData.params.topPicImg)
          return this.propsData.params.topPicImg;

        if (this.propsData.params.lineNum == 1) return topicLineOne;
        if (this.propsData.params.lineNum == 2) return topicLineTwo;
      }
    },
  },
  methods: {},
};
</script>

<style lang="scss" scoped>
.topPic {
  width: 100%;
  .template-default {
    width: 100%;
    padding: 9px 12px;
    display: flex;
    align-items: center;
    overflow: hidden;
    .topic-img,
    .heigter-img {
      width: 76px;
      flex-shrink: 0;
      img {
        width: 100%;
      }
    }
    .heigter-img {
      width: 40px;
    }
    .topic-body {
      // flex: 1;
      width: 82%;
      flex-shrink: 0;
      display: flex;
      // align-items: center;
      flex-direction: column;
      .topic-body-item {
        width: 100%;
        display: flex;
        align-items: center;
        margin-bottom: 4px;
        .topic-word {
          width: 70%;
          font-size: 14px;
          font-family: PingFang SC;
          font-weight: 400;
          color: #262626;
          padding: 0 6px 0 6px;
          overflow: hidden;
          white-space: nowrap;
          text-overflow: ellipsis;
          border-right: 1px solid #ebebeb;
          margin-bottom: 0;
          box-sizing: content-box;
        }
        .more {
          width: 40px;
          text-align: right;
          color: #888888;
          margin-bottom: 0;
        }
      }
      .topic-body-item:last-child {
        margin-bottom: 0;
      }
    }
  }
}
</style>
